PBResolveFileIDRef
You can use the PBResolveFileIDRef function to retrieve the filename and parent directory ID of the file with a specified file ID.
FUNCTION PBResolveFileIDRef (paramBlock: HParmBlkPtr;
async: Boolean): OSErr;
- paramBlock
- A pointer to an
fidParam variant of the HFS parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| <-> | ioNamePtr | StringPtr | A pointer to a filename. |
| --> | ioVRefNum | Integer | A volume specification. |
| <-- | ioSrcDirID | LongInt | The file's parent directory ID. |
| --> | ioFileID | LongInt | A file ID. |
DESCRIPTION
The PBResolveFileIDRef function returns the filename and parent directory ID of the file referred to by file ID in the ioFileID field. It places the filename in the string pointed to by the ioNamePtr field and the parent directory ID in the ioSrcDirID field. If the name string is NIL, PBResolveFileIDRef returns only the parent directory ID. If the name string is not NIL but is only a volume name, PBResolveFileIDRef ignores the value in the ioVRefNum field, uses the volume name instead, and overwrites the name string with the filename. A return code of fidNotFoundErr means that the specified file ID reference has become invalid, either because the file was deleted or because the file ID reference was destroyed by PBDeleteFileIDRef.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBResolveFileIDRef are
| Trap macro | Selector |
|---|
| _HFSDispatch | $0016 |
RESULT CODES
| noErr | 0 | No error |
| nsvErr | -35 | Volume not found |
| ioErr | -36 | I/O error |
| fnfErr | -43 | File not found |
| paramErr | -50 | Function not supported by volume |
| volOfflinErr | -53 | Volume is offline |
| extFSErr | -58 | External file system |
| wrgVolTypErr | -123 | Not an HFS volume |
| fidNotFoundErr | -1300 | File ID not found |
| notAFileErr | -1302 | Specified file is a directory |
| afpAccessDenied | -5000 | User does not have the correct access |
| afpObjectTypeErr | -5025 | Specified file is a directory |
| afpIDNotFound | -5034 | File ID not found |
| afpBadIDErr | -5039 | File ID not found |